/* 封装本地存储token  */
//本地获取
export const GET_TOKEN = (key) => {
  const data = window.localStorage.getItem(key)
  try {
    /*  if(typeof data =='object') {
        return JSON.parse(data)
     } */
    return JSON.parse(data)
  } catch (err) {
    console.log('获取本地缓存数据失败');
    return null
  }
}
//本地存储
export const SET_TOKEN = (key,value) => {
    if(typeof value=='object') {
      value=JSON.stringify(value)
    }
    window.localStorage.setItem(key,value)
}
//本地删除
export const DEL_TOKEN= (key)=> {
    return window.localStorage.removeItem(key)
}
